﻿/// <reference path="jquery.min.js" />
$(function () {
    if (!$.cookie("username") || $.cookie("username") == "null") {
        window.location.href = "peoplemgr.html";
        return;
    }
    $.post("request.ashx", { cmd: "bumen" }, function (data) {
        var json =eval(data);
        for(var i= 0; i<json.length;i++)
        {
            $(".bumen").append('<option value="' + json[i]["bid"] + '">' + json[i]["title"] + '</option>');
        }
    });
    $.post("request.ashx", { cmd: "zhiwei" }, function (data) {
        var json = eval(data);
        for (var i = 0; i < json.length; i++) {
            $(".zhiwei").append('<option value="' + json[i]["zid"] + '">' + json[i]["title"] + '</option>');
        }
    });
    $(".luru").click(function () {
        $.post("request.ashx", { cmd: "luru", zhiwei: $(".zhiwei").val(), bumen: $(".bumen").val(), nicheng: $(".nicheng").val(), age: $(".age").val(), phone: $(".phone").val(), qq: $(".qq").val() }, function (data) {
            if (data == "ok") {
                window.location.href = "peoplemgr.html";
            }
        });
    });

});